<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	FacturaBean factura = (FacturaBean)session
			.getAttribute("factura");
%>

<%@page import="Entities.FacturaBean"%>
<%@page import="Entities.ItemFacturaBean"%>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
	
	<title>Editable Invoice</title>
	
	<link rel='stylesheet' type='text/css' href='css/stylefactura.css' />
	<script type='text/javascript' src='js/jquery-1.3.2.min.js'></script>
	<script type='text/javascript' src='js/example.js'></script>

</head>

<body>

	<div id="page-wrap">

		<textarea id="header">FACTURA</textarea>
		<div id="identity">
		
            <textarea id="address">DATOS DEL CLIENTE</textarea>


              		
		</div>
		
		<div style="clear:both"></div>
		
		<div id="customer">

            <textarea id="customer-title">Rodamientos - IA 2011</textarea>

            <table id="meta"> 
                <tr>
                    <td class="meta-head"># Factura</td>
                    <td><%=factura.getIdFactura()%></td>
                </tr>
                <tr>

                    <td class="meta-head">Fecha</td>
                    <td><%=factura.getFechaEmision()%></td>
                </tr>
                <tr>
                    <td class="meta-head">Total</td>
                    <td>$ <%=factura.getTotal()%></td>
                </tr>

            </table>
		
		</div>
		
		<table id="items">
		
		  <tr>
		      <th>Rodamiento</th>
		      <th>Descripcion</th>
		      <th>Precio unitario</th>
		      <th>Cantidad</th>
		      <th>Total</th>
		  </tr>
		  <%
		  for(ItemFacturaBean it: factura.getItemsFactura())
		  {
		  %>
		  <tr class="item-row">
		      <td class="item-name"><%=it.getRodamiento().getCodigo()%></td>
		      <td class="description"><%=it.getRodamiento().getCaracteristica()%></td>
		      <td><%=it.getPrecioUnitario() %></td>
		      <td><%=it.getCantidad()%></td>
		      <td>$ <%=it.getPrecioTotal()%></td>
		  </tr>
		  <%
		  	}	
		  %>
	
		  
		  <tr>
		      <td colspan="2" class="blank"> </td>
		      <td colspan="2" class="total-line">Subtotal</td>
		      <td class="total-value"><div id="subtotal"><%=factura.getSubtotal() %></div></td>
		  </tr>
		  <tr>
		      <td colspan="2" class="blank"> </td>
		      <td colspan="2" class="total-line balance">Suma total</td>
		      <td class="total-value balance"><div class="due">$875.00</div></td>
		  </tr>
		
		</table>
		
		</div>
	
</body>

</html>